﻿@{
    Layout = "";

    var gridPageSize = EngineContext.Current.Resolve<AdminAreaSettings>().GridPageSize;
}
@model ConfigurationModel
@using Nop.Plugin.Misc.Reservations.Models;
@using Nop.Web.Framework;
@using Telerik.Web.Mvc.UI;
@using Nop.Core.Domain.Catalog;
@using Nop.Core.Infrastructure;
@using Nop.Core.Domain.Common;
@using (Html.BeginForm())
{
    <table class="adminContent">
        <tr>
            <td class="adminTitle">
                @Html.NopLabelFor(model => model.MaxAdvanceReserveDays):
            </td>
            <td class="adminData">
                @Html.EditorFor(model => model.MaxAdvanceReserveDays)
                @Html.ValidationMessageFor(model => model.MaxAdvanceReserveDays)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.NopLabelFor(model => model.TimeDuration):
            </td>
            <td class="adminData">
                @Html.EditorFor(model => model.TimeDuration)
                @Html.ValidationMessageFor(model => model.TimeDuration)
            </td>
        </tr>
        <tr>
            <td colspan="2">
                @(Html.Telerik().Grid<Product>()
                    .Name("tax-countrystatezip-grid")
                    .DataKeys(keys => keys.Add(x => x.Id).RouteKey("Id"))
                    .Columns(columns =>
                    {
                        columns.Bound(x => x.Name).Width(200).ReadOnly();
                        columns.Bound(x => x.ShortDescription).Width(200).ReadOnly();
                        columns.Command(commands =>
                        {
                            commands.Delete().Text(T("Admin.Common.Delete").Text);
                        }).Width(100);
                    })
                    .DataBinding(dataBinding =>
                    {
                        dataBinding.Ajax()
                            .Select("ProductList", "Reservation", new RouteValueDictionary() { { "Namespaces", "Nop.Plugin.Misc.Reservations.Controllers" }, { "area", "" } })
                            .Delete("RemoveFeaturedProduct", "Reservation", new RouteValueDictionary() { { "Namespaces", "Nop.Plugin.Misc.Reservations.Controllers" }, { "area", "" } });
                    })
                    .Pageable(settings => settings.PageSize(gridPageSize).Position(GridPagerPosition.Both))
                    .EnableCustomBinding(true)
                )
            </td>
        </tr>
        <tr>
            <td colspan="2" style="width:100%;">
                <input type="submit" name="save" class="t-button" value="@T("Admin.Common.Save")" />
            </td>
        </tr>
    </table>
}
